package com.taotao.tools.jackson.annotations;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.taotao.tools.jackson.constant.DefaultValue;
import com.taotao.tools.jackson.serializer.Default2NullSerializer;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
 * 将默认值转化为null.方便前端显示
 *
 * @author youbeiwuhuan
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
@JacksonAnnotationsInside
@JsonSerialize(using = Default2NullSerializer.class)
public @interface Default2Null {
    /**
     * 默认值,默认的默认值参考{@link DefaultValue}
     *
     * @return
     */
    String value() default "";
}